package com.ziqing.apeletnews.login;

import android.os.Bundle;
import android.widget.TextView;
import android.widget.Toast;

import com.ziqing.apeletnews.R;
import com.ziqing.apeletnews.base.BaseActivity;
import com.ziqing.apeletnews.login.contact.LoginContact;
import com.ziqing.apeletnews.login.prenstener.LoginPresenter;

import butterknife.BindView;
import butterknife.ButterKnife;

public class LoginActivity extends BaseActivity<LoginContact.LoginView, LoginPresenter> implements LoginContact.LoginView{

   @BindView(R.id.state)
    TextView NickName;
    @Override
    protected LoginPresenter createPresenter() {
        return new LoginPresenter(this);
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_login);
        ButterKnife.bind(this);
        mPresenter.login();
    }

    @Override
    public void loginSuccess(String nickname) {
        Toast.makeText(this, ""+nickname, Toast.LENGTH_SHORT).show();
        NickName.setText(nickname);
    }

    @Override
    public String getPhone() {
        return "18158653013";
    }

    @Override
    public String getPassword() {
        return "123456";
    }



}
